From d6102a7e711e40cdef6e1e5f387ea660f1ee03cb Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Thu, 25 Nov 2004 18:12:31 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.457 (41a6208fnzPMz8K5OTxEm1zY27pA-w) traps.c, memory.c: Reposition big lock around writable pagetable fault handler. --- xen/arch/x86/memory.c | 8 -------- xen/arch/x86/traps.c | 4 +++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index fc57e0bf1c..f5eac75ffe 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -1761,9 +1761,7 @@ int ptwr_do_page_fault(unsigned long addr) l2_pgentry_t *pl2e; int which, cpu = smp_processor_id(); u32 l2_idx; - struct domain *d = current->domain; - LOCK_BIGLOCK(d); /* * Attempt to read the PTE that maps the VA being accessed. By checking for * PDE validity in the L2 we avoid many expensive fixups in __get_user(). @@ -1772,7 +1770,6 @@ int ptwr_do_page_fault(unsigned long addr) _PAGE_PRESENT) || __get_user(pte, (unsigned long *)&linear_pg_table[addr>>PAGE_SHIFT]) ) { - UNLOCK_BIGLOCK(d); return 0; } @@ -1783,7 +1780,6 @@ int ptwr_do_page_fault(unsigned long addr) if ( ((pte & (_PAGE_RW | _PAGE_PRESENT)) != _PAGE_PRESENT) || ((page->u.inuse.type_info & PGT_type_mask) != PGT_l1_page_table) ) { - UNLOCK_BIGLOCK(d); return 0; } @@ -1791,7 +1787,6 @@ int ptwr_do_page_fault(unsigned long addr) l2_idx = page->u.inuse.type_info & PGT_va_mask; if ( unlikely(l2_idx >= PGT_va_unknown) ) { - UNLOCK_BIGLOCK(d); domain_crash(); /* Urk! This L1 is mapped in multiple L2 slots! */ } l2_idx >>= PGT_va_shift; @@ -1870,12 +1865,9 @@ int ptwr_do_page_fault(unsigned long addr) /* Toss the writable pagetable state and crash. */ unmap_domain_mem(ptwr_info[cpu].ptinfo[which].pl1e); ptwr_info[cpu].ptinfo[which].l1va = 0; - UNLOCK_BIGLOCK(d); domain_crash(); } - UNLOCK_BIGLOCK(d); - return EXCRET_fault_fixed; } diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 11687c0573..1a7a52c05d 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -386,11 +386,11 @@ asmlinkage int do_page_fault(struct xen_regs *regs) if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) ) { + LOCK_BIGLOCK(d); if ( unlikely(ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l1va) && unlikely((addr >> L2_PAGETABLE_SHIFT) == ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) ) { - LOCK_BIGLOCK(d); ptwr_flush(PTWR_PT_ACTIVE); UNLOCK_BIGLOCK(d); return EXCRET_fault_fixed; @@ -402,8 +402,10 @@ asmlinkage int do_page_fault(struct xen_regs *regs) { if ( unlikely(ed->mm.shadow_mode) ) (void)shadow_fault(addr, regs->error_code); + UNLOCK_BIGLOCK(d); return EXCRET_fault_fixed; } + UNLOCK_BIGLOCK(d); } if ( unlikely(ed->mm.shadow_mode) && -- 2.30.2